package com.tengol.demo.design.pattern.structural.flyweight.demo1;

/**
 * 单元测试：享元模式
 *
 * @author dongrui
 * @date 2019/03/07
 */
public class FlyWeightTest {
    public static void main(String[] args) {
        Flyweight x = FlyweightFactory.getFlyweight("X");
        x.operate();
        Flyweight y = FlyweightFactory.getFlyweight("Y");
        y.operate();
        Flyweight z = FlyweightFactory.getFlyweight("Z");
        z.operate();
        Flyweight x1 = FlyweightFactory.getFlyweight("X");
        x1.operate();
        Flyweight unsharedFlyweight = new UnsharedConcreteFlyweight("X");
        unsharedFlyweight.operate();

    }
}
